﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ConvertToText
/// </summary>
public class ConvertToText 
{ 
    
    string columnName;
    string value;
    List<ICheckAndConvertValues> convertType;

    public ConvertToText(string columnName,string value)
	{
        this.columnName = columnName;
        this.value = value;
        convertType = new List<ICheckAndConvertValues>();

        convertType.Add(new Type_ChiTieuTangTruong(columnName, value));
        convertType.Add(new Type_CoKhong(columnName, value));
        convertType.Add(new Type_KhaNang(columnName, value));
        convertType.Add(new Type_LuaChonMucDo(columnName, value));
        convertType.Add(new Type_MucDoCapNhat(columnName, value));
        convertType.Add(new Type_MucDoTinhXao(columnName, value));
        convertType.Add(new Type_NangLuc(columnName, value));
        convertType.Add(new Type_PhongCachLanhDao(columnName, value));
        convertType.Add(new Type_QuanTrong(columnName, value));
        convertType.Add(new Type_QuyMo(columnName, value));
        convertType.Add(new Type_QuyMoThiTruong(columnName, value));
        convertType.Add(new Type_TanSuat(columnName, value));
        convertType.Add(new Type_TinhTrangHienTai(columnName, value));
        convertType.Add(new Type_ViTheDoanhNghiep(columnName, value));
	}


    public QuestionObject getNewQuestionObject()
    {
        QuestionObject qObject=new QuestionObject();

        
        foreach (var x in convertType)
        {
            if (x.isExistSymbol())
            {
                qObject.setValue(x.getText());
                qObject.setColumName(columnName);
                return qObject;
            }
        }

        return null;

    }

}